<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>最大值</title>

    <script>
        var a = [2, 5, 16, 6, 24, 236];
        var max = a[0];
        for (var i = 0; i < a.length; i++) {
            if (max < a[i]) {
                max = a[i];
            }
        }
        console.log('最大值:' + max);
    </script>

</head>

<body>

</body>

</html>